//
//  CertificateModel.m
//  VideoExam
//
//  Created by apple on 2020/4/17.
//

#import "CertificateModel.h"

@implementation CertificateModel

///获取证书中心数据列表
+ (void)get_Certificate_List_page:(int)page Success:(ArraySuccess)success error:(ErrorBlock)errorBlock {
    NSString * url = [NSString stringWithFormat:@"%@%d",get_Certificate_List_url,page];
    [NetWorkTools requestWithURLStr:url method:GET params:nil success:^(id responseObject) {
        NSLog(@"获取证书中心数据列表 %@",responseObject);
        if ([AppTools isStateSuccess:responseObject]) {
            NSArray *array = [NSArray new];
            if ([AppTools is_parsing_security_responseObject:responseObject]) {
                array = [NSArray yy_modelArrayWithClass:[CertificateModel class] json:responseObject[@"data"][@"records"]];
            }
          if (success) {
              success(array);
           }
        } else {
            if (errorBlock) {
                errorBlock();
            }
        }
    } failure:^(NSError *error) {
        if (errorBlock) {
            errorBlock();
        }
        NSLog(@"获取证书中心数据列表error %@",error);
        NSString *errorStr = [self errorDescribe:error];
        [QMUITips showError:errorStr];
    }];
}


@end
